import org.junit.Test;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

/**
 * 描述  :
 * 创建人:    Wzy
 * 创建时间: 2020-06-09  19:29
 */
public class Time {
    @Test
    public void test() throws InterruptedException {
        Timer timer = new Timer();
        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {
                System.out.println("123");
            }
        };
        LocalDateTime date = LocalDateTime.of(2020, 6, 9, 19, 45, 55);
        Date date1 = new Date(date.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
        timer.schedule(timerTask, date1);
        Thread.sleep(100000);
    }
}
